home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 9 / AMUG BBS in a Box Volume IX (August 1993) (MacWizards).iso / Files / Util / Pm-Pz / POSTSCRIPTIONS!.CPT / PostScriptions! / PostScriptions Templates / Button with Background / Button with Background
Encoding:
Text File  |  1987-07-03  |  2.2 KB  |  131 lines  |  [GPPS/LIST]

  1. % button text
  2. % Gregory Kruckewitt
  3. % 3-March-87
  4. % var for fill  page
  5. /TM 780 def
  6. /BM -12 def
  7. /LM 0 def
  8. /RM 612 def
  9. /newline
  10. { currentpoint 13 sub
  11. exch pop LM
  12. exch moveto } def
  13.  
  14. /nllfNec
  15. { currentpoint pop RM gt
  16. {newline} if } def
  17.  
  18. /done?
  19. { currentpoint exch pop BM lt } def
  20.  
  21. /fillpage
  22. { /strg exch def
  23. { { pop pop nllfNec} strg kshow
  24. done? {exit} if
  25. } loop
  26. } def
  27.  
  28. /outsidecircletext
  29.     {circtextdict begin
  30.         /radius exch def
  31.         /centerangle exch def
  32.         /ptsize exch def
  33.         /str exch def
  34.         /xradius radius ptsize 4 div add def
  35.  
  36.     gsave
  37.     centerangle str findhalfangle add rotate
  38.  
  39. str
  40. {/charcode exch def
  41.         ( ) dup 0 charcode put outsideplacechar
  42. }forall
  43.     grestore
  44.     end
  45. }def
  46.  
  47. /insidecircletext
  48. {circtextdict begin
  49.         /radius exch def  /centerangle exch def
  50.         /ptsize exch def  /str exch def
  51.  
  52.     /xradius radius ptsize 3 div sub def
  53.     gsave
  54.   centerangle str findhalfangle sub rotate
  55. str
  56.  {/charcode exch def
  57.             ( ) dup 0 charcode put insideplacechar
  58. }forall
  59. grestore
  60. end
  61. }def
  62.  
  63. /circtextdict 16 dict def
  64.     circtextdict begin
  65. /findhalfangle
  66.         {stringwidth pop 2 div
  67.   2 xradius mul pi mul div 360 mul
  68. }def
  69.  
  70.  
  71. /outsideplacechar
  72. {/char exch def
  73.     /halfangle char findhalfangle def
  74. gsave
  75.         halfangle neg rotate
  76.     radius 0 translate
  77.     -90 rotate
  78.     char stringwidth pop 2 div neg 0 moveto
  79. char show
  80. grestore
  81. halfangle 2 mul neg rotate
  82. }def
  83.  
  84. /insideplacechar
  85. {/char exch def
  86.     /halfangle char findhalfangle def
  87.     gsave
  88.     halfangle rotate
  89.     radius 0 translate
  90.     90 rotate
  91.         char stringwidth pop 2 div neg 0 moveto
  92.     char show
  93.     grestore
  94.     halfangle 2 mul rotate
  95. }def
  96.  
  97.     /pi 3.1415923 def
  98. end
  99.  
  100. /Badge         
  101.     {
  102.     /Times-Bold findfont 18 scalefont setfont
  103.  
  104.     topline % top of circle text
  105.  
  106.     18 90 65 outsidecircletext
  107.     /Times-Bold findfont 15 scalefont setfont
  108.  
  109.     bottomline % bottom of circle text
  110.  
  111.     15 270 70 insidecircletext
  112.     
  113. } def
  114. /cutline
  115. {newpath .3 setgray 0 3 98 0 360 arc stroke 0 setgray } def   % draw circle?
  116.  
  117. % Place the badge 4 times on page
  118. gsave 
  119. /Times-Bold findfont 10 scalefont setfont
  120. LM TM moveto
  121. .8 setgray
  122. background fillpage
  123. grestore
  124.  
  125. gsave 157 600 translate cutline Badge grestore % upper left
  126. gsave 449 600 translate cutline Badge grestore % upper right
  127. gsave 157 266 translate cutline Badge grestore % lower left
  128. gsave 449 266 translate cutline Badge grestore  % lower right
  129.  
  130. showpage
  131.